﻿ 

	
<!DOCTYPE html>  
<html>  
<head>  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
    <meta name="keywords" content="客户合同">  
    <meta name="description" content="客户合同">  
    <title>客户合同管理</title>  
    
    <%@ include file="/WEB-INF/inc/default.jsp"%>
    <jsp:include page="/WEB-INF/inc/dic.jsp"/>

</head>  
  <script>
      
         function doSelect(pcallback){
           var rows = $('#dg').datagrid('getSelections');
            if (!rows||rows.length==0){
            	 $.messager.alert('提示','请选择行','info');
            	 return;
            }
            if (!rows||rows.length>1){
            	 $.messager.alert('提示','不能选择多行','info');
            	 return;
            }
            
            if (rows){  
            	  var contract={};
                contract.id=rows[0].id;
                contract.name=rows[0].name;
                
                
                if (callback) callback(contract,closeWin);
            }  
         }
       
  </script>
<body>  
    
      
    <table id="dg"  style="width:1050px;height:300px"  
            url="/customer/customerContract/list.do"  
            toolbar="#toolbar" pagination="true"  
            rownumbers="true" fitColumns="true" loadMsg="正在查询,请稍候..." singleSelect="false">  

    </table>  
    <div  style="text-align:center">  
          <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="doSelect();">确定</a>            
          <a href="javascript:void(0)" id="btn-close" class="easyui-linkbutton" onclick="closeWin()" iconCls="icon-cancel">关闭</a>  
    </div>
    <div id="toolbar">  
        
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="find()">查询</a>
    </div>  
    
    <!-- query form窗体(开始) -->  
    <div id="dlg_query" style="display:none;">  
    	  <!--
        <div class="ftitle">客户合同</div>  
        <form itemId="fmquery" method="post" novalidate>  
            
              
	        		     <div class="fitem">  
                     <label style="width:100px">合同编号:</label>                                            
                     <input name="nbr" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">客户id:</label>                       
                     <input name="custId" class="easyui-numberbox">                       
                   </div>	        		     
	        		     <div class="fitem">  
                     <label style="width:100px">title:</label>                                            
                     <input name="title" class="easyui-box">                       
                   </div> 
        	  	   	 <div class="fitem">  
                     <label style="width:100px">合同格式:</label>                                            
                     
                     
                     <input class="easyui-combobox" name="contractStyle" style="width:200px;"  data-options="data:__getConstantCategory('ContractStyle'),valueField:'code', textField:'value', multiple:false,panelHeight:'auto',mode:'remote' ">
                     
                   </div>      	
        	  	   	 <div class="fitem">  
                     <label style="width:100px">合同类型(字典获取):*固定收费-有预付 *固定收费 *年收费-月薪-最低收费-预付 *年收费-年薪-最低收费 :</label>                                            
                     
                     
                     <input class="easyui-combobox" name="contractType" style="width:200px;"  data-options="data:__getConstantCategory('ContractType'),valueField:'code', textField:'value', multiple:false,panelHeight:'auto',mode:'remote' ">
                     
                   </div>      	
	        		     <div class="fitem">  
                     <label style="width:100px">合同语种:</label>                                            
                     <input name="lang" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">合同费率:</label>                                            
                     <input name="arRate" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">最低收费:</label>                       
                     <input name="minAr" class="easyui-numberbox">                       
                   </div>	        		     
	        		     <div class="fitem">  
                     <label style="width:100px">合同开始日期:</label>                       
                     <input name="beginD" data-options="formatter:formateDate" class="easyui-datebox">                         	
                   </div>  	        		     
	        		     <div class="fitem">  
                     <label style="width:100px">合同结束日期:</label>                       
                     <input name="endD" data-options="formatter:formateDate" class="easyui-datebox">                         	
                   </div>  	        		     
	        		     <div class="fitem">  
                     <label style="width:100px">付款时间:</label>                       
                     <input name="arD" class="easyui-numberbox">                       
                   </div>	        		     
	        		     <div class="fitem">  
                     <label style="width:100px">预付款:</label>                       
                     <input name="preAr" class="easyui-numberbox">                       
                   </div>	        		     
	        		     <div class="fitem">  
                     <label style="width:100px">预付款时间:</label>                       
                     <input name="preArD" data-options="formatter:formateDate" class="easyui-datebox">                         	
                   </div>  	        		     
	        		     <div class="fitem">  
                     <label style="width:100px">预付款单位:</label>                                            
                     <input name="preUnit" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">保证期(试用期):</label>                                            
                     <input name="trialMonths" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">退款比例:</label>                       
                     <input name="refundRate" class="easyui-numberbox">                       
                   </div>	        		     
	        		     <div class="fitem">  
                     <label style="width:100px">滞纳金比例:</label>                       
                     <input name="delayRate" class="easyui-numberbox">                       
                   </div>	        		     
	        		     <div class="fitem">  
                     <label style="width:100px">其他特别条款:</label>                                            
                     <input name="searchLimit" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">其他备注:</label>                                            
                     <input name="comment" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">创建人:</label>                                            
                     <input name="creator" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">创建时间:</label>                       
                     <input name="createDt" data-options="formatter:formateDate" class="easyui-datebox">                         	
                   </div>  	        		     
	        		     <div class="fitem">  
                     <label style="width:100px">修改人:</label>                                            
                     <input name="modifier" class="easyui-box">                       
                   </div> 
	        		     <div class="fitem">  
                     <label style="width:100px">修改时间:</label>                       
                     <input name="modifiedDt" data-options="formatter:formateDate" class="easyui-datebox">                         	
                   </div>  	        		     
              
              
        </form>
         <div  style="text-align:center">  
                    <a href="javascript:void(0)" itemId="btn-query" class="easyui-linkbutton" iconCls="icon-ok" ">查询</a>  
                    <a href="javascript:void(0)" itemId="btn-close" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>  
        </div> 
        -->
    </div> 
    <!-- query form窗体(结束) -->  
    
    <script type="text/javascript">  
        var url;  
        
      
		    
		    var queryWin = $.window({
		       		 title:"客户合同查询",
		       		 tplRef:"dlg_query",//这个属性指定模板id
		       		 height:200,		       		 
		       		 closed:true,		       		 
		       		 onComplete:function(){
		       		 	  //窗口里面的初始化,最好是在这个事件里面进行
		       		 	  var curWin=this;
		       		 	  var doForm=curWin.find('#fm_query');
		       		 	  curWin.doForm=doForm;
		       		 	  this.find('a[itemId="btn-close"]').click(function(){	       		 	  	
		       		 	  	   curWin.window('close');
		       		 	  });
		       		 	  this.find('a[itemId="btn-query"]').click(function(){
		       		 	  			                 		  
		                 		 //var formdata=$('#fm_query').formToArray(); 
		                 		 curWin.window('close');
		                 		 //curWin.find('form[itemId="fmquery"]');
		                 		 //var formdata=curWin.find('#fm_query').formToArray();   		 
		                 		 //curWin.openerWin.query(formdata);
		                 		 
		                 		 
		                 		  var formdata=curWin.find('form[itemId="fmquery"]').formToArray();   		 
		                      curWin.openerWin.query(formdata);
		              });
		       		   
		       		 }
		    });
        
        
        
        function reload(){        	
        	  $('#dg').datagrid('reload');
        }
        function find(){  
              
                //$('#dlg_query').dialog('open').dialog('setTitle','查询');  
                
                //url = '/customer/customerContract/list.do';  
                 queryWin.window('open');   
                 queryWin.openerWin=window; 
              
        } 
        	
        function query(formdata){  
                
                $('#dg').datagrid({
	                  queryParams: array2json(formdata)
                });
              
        }
        
        //生成grid的字段,需要字典的自动转换
        $('#dg').datagrid({
        	   columns:[[
        	   	
        	   	   {field:'nbr',title:'合同编号', width:100}
        	   	   ,{field:'custName',title:'客户', width:100}
        	   	   ,{field:'title',title:'title', width:100}
        	   	   ,{field:'contractStyle',title:'合同格式', width:100,
        	   		      formatter: function(value,row,index){
        	   		      	return __getConstantCategoryCodeValue('ContractStyle', value);
        	   		      }
        	   	     }
        	   	   ,{field:'contractType',title:'合同类型', width:100,
        	   		      formatter: function(value,row,index){
        	   		      	return __getConstantCategoryCodeValue('ContractType', value);
        	   		      }
        	   	     }
        	   	   ,{field:'lang',title:'合同语种', width:100,
        	   	   	formatter: function(value,row,index){
        	   		      	return __getConstantCategoryCodeValue('ContractLang', value);
        	   		      }
        	   	   	}
        	   	   ,{field:'arRate',title:'合同费率', width:100}
        	   	   ,{field:'minAr',title:'最低收费', width:100}
        	   	   ,{field:'beginD',title:'合同开始日期', width:100}
        	   	   ,{field:'endD',title:'合同结束日期', width:100}
        	   	   ,{field:'arD',title:'付款时间', width:100}
        	   	   ,{field:'preAr',title:'预付款', width:100}
        	   	   ,{field:'preArD',title:'预付款时间', width:100}
        	   	   ,{field:'preUnit',title:'预付款单位', width:100}
        	   	   ,{field:'trialMonths',title:'保证期(试用期)', width:100}
        	   	   ,{field:'refundRate',title:'退款比例', width:100}
        	   	   ,{field:'delayRate',title:'滞纳金比例', width:100,hidden:true}        	   	          	   	   
        	   	   ,{field:'creator',title:'创建人', width:100}
        	   	   ,{field:'createDt',title:'创建时间', width:100}
        	   	   ,{field:'modifier',title:'修改人', width:100,hidden:true}
        	   	   ,{field:'modifiedDt',title:'修改时间', width:100,hidden:true}
        	   	
        	   	
        	   ]]
        	   
        }); 
        //完成-生成grid的字段
        
        
        
    </script>  
     
     

     
     
     
</body>  
</html>